package com.mms.controller.admin;

import com.mms.pojo.User;
import com.mms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;

/**
 * Created by dan3652@sina.com on 2016-11-24 11:08.
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/get/{id}")
    public String toIndex(@PathVariable Integer id, HttpServletRequest request, Model model) {
        User user = this.userService.get(id);
        model.addAttribute("user", user);
        return "test";
    }
}
